package com.frank.libandroid;

import java.util.HashMap;
import java.util.Map;

public class DataStore {
    private static Map<Integer, Object> map = new HashMap<>();

    public static <T> void put(Key<T> key, T value) {
        map.put(key.key, value);
    }

    public static <T> T get(Key<T> key) {
        return (T) map.remove(key.key);
    }


    public static void put(String key, Object value) {
        paramMap.put(key, value);
    }

    private static Map<String, Object> paramMap = new HashMap<>();

    public static <T> T remove(String key) {
        return (T) paramMap.remove(key);
    }

    public static <T> T get(String key) {
        return (T) paramMap.get(key);
    }
}
